More details on load-foreign

The full specification of the load-foreign function is

(load-foreign filespec optionalLibstring optionalOtherstring)
filespec can be any T filespec and corresponds to the UNIX .o file to be loaded in. load-foreign will check for its existence. You have to specify the full name of the file including the .o extension. The optionalLibstring is optional, and can be used to specify libraries if necessary. For example, if the file you are loading in uses X Window System graphics functions then the load-foreign command you execute will probably look like
(load-foreign   "mygraphics.o"   "-lX")
Note that you have to type in -lX and not just X. Also, if you need other libraries, include the libraries in the same string. For example, if you need both the X library and the dbm library, then the command will look something like
(load-foreign   "mygraphics.o"   "-lX -ldbm")
The order of the libraries specified is significant and the C library -lc is automatically included at the end and so need not be specified. This is the sanctioned way of accessing libraries. Do not link in libraries into a .o and then attempt to load in that .o file. That scheme might not always work if the libraries have been previously loaded in, whereas the sanctioned scheme will always work. load-foreign returns #t if everything worked ok, and returns #f otherwise. The optionalOtherstring will not be used by ``normal'' users and is further discussed in section [*].

Unfortunately, it is not currently possible to reload a UNIX .o file into a running T. You will have to exit the T and start up a new one. If an error is discovered in a C function already loaded in, a new T will have to be started up and the corrected recompiled C file will have to be loaded in.